package com.corpdata.system.org.dao;

import java.util.Map;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.cache.annotation.Cacheable;

import com.corpdata.system.org.entity.User;
import com.github.pagehelper.Page;

@Mapper
public interface UserMapper {
	
	@Select("<script>select * from org_user where 1=1 " + 
			"<if test='userId != null'>and userid='${userId}'</if> "+
			"<if test='sDate != null'>and created>='${sDate}'</if> "+
			"</script>")
	Page<User> selectByPage(Map<String, Object> searchParams);
	
	int insert(User user);
	
	@Select("select userid,user_name userName,id from org_user where userid=#{userid}")
	User selectByUid(String userid);
}
